home *** CD-ROM | disk | FTP | other *** search
/ Sun Solutions 1997 April to September / Sun Solutions CD - APR '97 - SEP '97 (704-3778-12 Rev. H)(Sun Microsystems, Inc.)(1997).iso / products / Legato / forms / INSTALL.SH < prev    next >
Linux/UNIX/POSIX Shell Script  |  1997-02-21  |  3KB  |  151 lines

  1. #! /bin/sh  
  2. #
  3. #    Installation shell script for Catalyst CDware
  4. #
  5. #       Usage: install -m<mountpoint> -p<productpath>
  6. #
  7. #    Created:     June 12, 1991
  8. #       Last Revised:   May 28, 1996
  9. #                 
  10. #    Use this installation script to install your product from Catalyst CDware
  11. #
  12. #
  13. #    For technical support, please call.
  14. #        +1 415 336.3742 (CDware SPARC) or +1 415 336.3941 (CDware x86)
  15. #
  16. #    get command line parameters
  17. #
  18.  
  19. # function for error exiting
  20.  
  21. end_it () {
  22. echo " "
  23.   echo "Hit return to end ... "
  24.   read answer
  25.  
  26. exit 0
  27. }
  28.  
  29.  
  30. #    set PRODUCT_SIZE to the size of your product in kbytes     
  31.  
  32. PRODUCT_SIZE=24000
  33.  
  34. #
  35. #    get complete paths
  36. #
  37. #
  38. #    get location of installation directory 
  39. ##
  40. echo
  41. #echo "Please enter the absolute path name of the directory structure in which"
  42. #echo "you would like to install the NetWorker evaluation program."
  43. #echo
  44. #echo "Installation directory: "
  45. #read INSTALL_DIR
  46.  
  47. INSTALL_DIR=/tmp/networker
  48.  
  49. #
  50. #    verify the installation directory exists and is a directory
  51. #
  52. if [ ! -d "$INSTALL_DIR" ]
  53. then
  54.     echo "Creating $INSTALL_DIR ..."
  55.     mkdir $INSTALL_DIR
  56.     if [ ! -d "$INSTALL_DIR" ]
  57.     then
  58.         echo
  59.         echo
  60.         echo "Could not create the installation directory."
  61.         echo
  62.         echo "Exiting the installation script."
  63.                 end_it
  64.     fi
  65. fi
  66.  
  67. #
  68. #    verify write permission for the installation directory
  69. #
  70. if [ ! -w "$INSTALL_DIR" ]
  71. then
  72.     echo
  73.     echo
  74.     echo "You do not have write permission for the installation directory: "
  75.     echo $INSTALL_DIR
  76.     echo
  77.         echo
  78.     echo "Exiting the installation script."
  79.         end_it
  80. fi
  81.  
  82. #
  83. #    verify free disk space
  84. #
  85. echo    
  86. echo    "Verifying free disk space..."
  87. FREE_SPACE=0
  88. df=/tmp/FREE.$$
  89. #
  90. # WARNING:
  91. # --------
  92. # For Solaris 2.4, the df line below will need to be updated because
  93. # the standard output of the df command has changed in Solaris 2.4
  94. #
  95. /usr/bin/df -k $INSTALL_DIR | sed /kbytes/d | sed -e '3,$d' | sed -e '1,$s/  */ /g' > $df
  96.  
  97. case `/usr/bin/wc -l $df | sed -e 's/^ *//' | cut -f1 -d" " ` in
  98.     1) FREE_SPACE=`cat $df | cut -f4 -d" "` ;; 
  99.     2) FREE_SPACE=`cat $df | sed 1d | sed 's/^ *//' | cut -f3 -d" "` ;; 
  100. esac
  101.  
  102. if [ -n $FREE_SPACE ]
  103. then
  104.     if [ $FREE_SPACE -lt $PRODUCT_SIZE ]
  105.     then
  106.         echo
  107.         echo
  108.         echo "The product installation requires $PRODUCT_SIZE kbytes of"
  109.         echo "free disk space. There is only $FREE_SPACE kbytes of free" 
  110.         echo "disk space in the selected filesystem.  Please free up some"
  111.         echo "disk space and try this installation again."
  112.         echo
  113.         echo "Exiting the installation script."
  114.             end_it     
  115.     fi
  116. fi
  117. /bin/rm $df 2>/dev/null
  118.  
  119. #
  120. #    copy binaries to installation directory
  121. #
  122. echo 
  123. echo "Copying files to "$INSTALL_DIR"..."
  124. echo
  125. #
  126. # uncomment the following line to do the actual copy
  127. #
  128.  
  129. cd $INSTALL_DIR
  130.  
  131. cp $COMPANY_DIR/forms/nw_sol.tar.Z $INSTALL_DIR
  132.  
  133. cd $INSTALL_DIR
  134. uncompress nw_sol.tar.Z
  135. echo " "
  136. echo " Uncompressing nw_sol.tar.Z ..."
  137. echo " "
  138. echo " "
  139. echo " Extracting nw_sol.tar ..."
  140.  
  141. tar xvf nw_sol.tar
  142. cd $INSTALL_DIR/SOLARIS
  143. /usr/sbin/pkgadd -d ./SOLARIS.PKG
  144. echo " "
  145. echo " "
  146. echo " Installation was a success."
  147. sleep 2
  148. more $COMPANY_DIR/_install/readme.txt
  149.  
  150. end_it
  151.